-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8371674: C2 fails with Missed optimization opportunity in PhaseIterGVN for MoveL2D #28290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back bmaillard! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@benoitmaillard The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
| long j[] = new long[N]; | ||
| while (++e < 37) { | ||
| for (f = 1; f < 7; f++) { | ||
| h >>>= (int)(--g - Double.longBitsToDouble(j[e])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by comment, might review more fully next week: could the same happen with MoveI2F? Or with MoveD2L, i.e. Double.doubleRawBitsToLong? Probably yes. Not sure if it's worth duplicating the test, up to you.
This PR addresses yet another missed optimization in
PhaseIterGVN. The way this optimization is triggered is a bit different this time though, and the notification is missing inNode::has_special_unique_user.Analysis
The affected optimization is the transformation of
MoveX2Y (LoadX mem)intoLoadY mem. This is implemented inMoveNode::Ideal. The optimization is as follows:The optimization is triggered only if the input is a
LoadNodeand theMoveNodeis its only user. This is a relatively unusual pattern.The bug was found by the fuzzer. At some point during IGVN, we have the following subgraph:
In
RegionNode::Ideal, we end up callingset_req_Xon thePhinode to delete the edge from thePhinode toLoadL. As a result, theLoadLnode only has one user left, and theMoveNode::Idealgets triggered at the next verification pass.Proposed Solution
Add this particular case to
Node::has_special_unique_user, which gets called byNode::set_req_X.Summary of changes
This PR brings the following changes:
Node::has_special_unique_user.TestMissingOptMoveX2YLoadX.java, initially obtained from the fuzzer and then heavily reduced, both with the usual tools and manually. I tried to get a reproducer for each of theMovenodes, but I was only able to get one forMoveL2D.Testing
Thank you for reviewing!
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28290/head:pull/28290$ git checkout pull/28290Update a local copy of the PR:
$ git checkout pull/28290$ git pull https://git.openjdk.org/jdk.git pull/28290/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28290View PR using the GUI difftool:
$ git pr show -t 28290Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28290.diff
Using Webrev
Link to Webrev Comment